package pt.ua.helpdesk.client;

import com.google.gwt.user.client.rpc.AsyncCallback;

/**
 * Login service. This is a remote service and logins
 * the user into the system
 * @author Amigos do Noddy
 *
 */
public interface ServiceLoginAsync {
	/**
	 * Checks whether the user and password are valid in
	 * the system
	 * 
	 * @param username Username
	 * @param pass Password
	 * @param callback the callback to return Array list containing the id, username and user type on success
	 */
	void loginCheck(String username, String pass, AsyncCallback callback);
	
	/**
	 * Registers a user in the system
	 * 
	 * @param username Username
	 * @param pass Password
	 * @param Email Email
	 * @param name Name
	 * @param callback the callback to return Returns a string with the error codes
	 */
	void registar(String username, String pass, String Email, String name, AsyncCallback callback);
	
	/**
	 * Activates an account
	 * 
	 * @param email Email
	 * @param codigo Activation code
	 * @param callback the callback to return True in the case of success
	 */
	void activar(String email, long codigo, AsyncCallback callback);
	
	/**
	 * Resets the user password
	 * @param email Email
	 * @param callback the callback to return True in the case of success
	 */
	void novapass(String email, AsyncCallback callback);
	
	/**
	 * Edits the user account
	 * 
	 * @param username Username
	 * @param pass Password
	 * @param callback the callback to return True in the case of success
	 */
	void editaccount(String username, String pass, String pass2, AsyncCallback callback);
}
